#ifndef COMMONFUN_H
#define COMMONFUN_H

#include "../opxml/globalrwxml.h"


//class ItemBase;

namespace CommonFun
{
    bool judgeSharedPtrSuccess(std::shared_ptr<RwXml> sharedPtrXml);
    bool judgeTiXmlNodeSuccess(TiXmlNode *pNode, const char *pName);

    //两个元素类型的比较方法
//    bool compareItemBase(ItemBase *pItemLeft, ItemBase *pItemRight);

    std::string getAttribute(TiXmlNode *pNode, const std::string &strName);

    //查找全局dom下结点的方法
    TiXmlNode *getChildNode(TiXmlNode *parentNode, const std::string &strName);
    TiXmlNode *getNode(const std::string &strName);
    TiXmlElement *getChildElement(TiXmlNode *parentNode, const std::string &strName);
    void delNode(TiXmlNode *pNode);
    TiXmlNode *insertBeforeChild(TiXmlNode *pParentNode, TiXmlNode *pBeforeNode, TiXmlNode *pAddNode);
}

#endif // COMMONFUN_H
